<template>
  <div>
<el-dialog title="题目审核" :visible="ShowCheckDialog" @close="closeCheckDialog">
  <el-form :model="ruleForm" ref="formRefs">
    <el-form-item>
     <el-radio v-model="ruleForm.radio" label="1">通过</el-radio>
     <el-radio v-model="ruleForm.radio" label="2">拒绝</el-radio>
    </el-form-item>
 <el-form-item >
  <el-input type="textarea" placeholder="请输入审核意见" v-model="ruleForm.chkRemarks" style="margin:15px 0"></el-input>
   </el-form-item>
   <el-form-item >
   <div style="float:right">
    <el-button @click="closeCheckDialog">取 消</el-button>
    <el-button type="primary" @click="submitCheck" >确 定</el-button>
   </div>
     </el-form-item>
    </el-form>
</el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    ShowCheckDialog: {
      type: Boolean,
      required: true
    }
  },
  data () {
    return {
      ruleForm: {
        radio: '1',
        chkRemarks: ''
      }
    }
  },
  methods: {
    closeCheckDialog () {
      this.$emit('update:ShowCheckDialog', false)
      this.ruleForm.chkRemarks = ''
    },
    submitCheck () {
      if (this.ruleForm.chkRemarks === '') {
        this.$message.error('请输入审核意见')
      } else {
        this.$emit('submitCheck', this.ruleForm)
        this.$message.success('审核修改成功')
        this.closeCheckDialog()
        this.$emit('getList')
      }
    }
  }
}
</script>

<style scoped lang='scss'>
::v-deep{
  .el-dialog{
    width: 400px;
  }
}
</style>
